import type { RouteRecordRaw } from 'vue-router'

export const staticRoutes: RouteRecordRaw[] = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/pages/login/index.vue'),
  },
  {
    path: '/phoneLogin',
    component: () => import('@/pages/phoneLogin/index.vue'),
  },
  {
    path: '/login/register',
    name: 'Register',
    component: () => import('@/pages/register/index.vue')
  },
  {
    path: '/404',
    name: '404',
    component: () => import('@/pages/error/index.vue'),
  },
  {
    path: '/',
    component: () => import('@/App.vue'),
    redirect: '/home',
    children: [
      {
        path: 'home',
        name: 'Home',
        component: () => import('@/pages/home/index.vue'),
        redirect: '/home/recommend',
        meta:{
          index:0
        },
        children: [
          {
            path: 'recommend',
            component: () => import('@/pages/home/recommend/index.vue')
          },
          {
            path: 'category/:categoryId',
            component: () => import('@/pages/home/category/index.vue'),

          },
        ]
      },

      {
        path:'categorydetail/:categoryType/:superCategoryId/:id',
        component:()=> import('@/pages/category/categoryDetail/index.vue')
      },
      {
        path: 'order',
        component: () => import('@/pages/order/index.vue')
      },
      {
        path:'category',
        component: () => import('@/pages/category/index.vue'),
        meta:{
          index:1
        },
      },
      {
        path:'categorydetail/:categoryType/:superCategoryId/:id',
        component:()=> import('@/pages/category/categoryDetail/index.vue')
      },
      {
        path:'worthbuy',
        component: () => import('@/pages/worthbuy/index.vue'),
        meta:{
          index:2
        }
      },
      {
        path:'cart',
        component: () => import('@/pages/cart/index.vue'),
        meta:{
          index:3
        }
      },
      {
        path: 'order',
        component:()=>import('@/pages/order/index.vue')
      },
      {
        path: 'personalInfo',
        component:()=>import('@/pages/personal/personalInfo/index.vue')
      },
      {
        path:'personal',
        component: () => import('@/pages/personal/index.vue'),
        meta:{
          index:4
        }
      },
      {
        path:'goods',
        children:[
          {
            path:'goodsdetail/:id',
            component:()=> import('@/pages/goods/goodsDetail/index.vue')
          }
        ]
      }
    ]
  },
  {
    path: '/search',
    name: 'search',
    component: () => import('@/pages/search/index.vue'),
  },
  {
    path: '/toshop',
    name: 'toshop',
    component: () => import('@/pages/search/components/hotShop/index.vue'),
  },
  {
    path: '/:pathMatch(.*)',
    name: 'Any',
    redirect: '/404',
  }
]

